package com.sinothk.hussars.controller;


import com.sinothk.hussars.entity.RecordProcessEntity;
import com.sinothk.hussars.entity.RoleEntity;
import com.sinothk.hussars.service.RecordProcessService;
import com.sinothk.hussars.service.RoleService;
import com.sinothk.server.support.annotation.callback.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.sinothk.hussars.base.BaseController;

/**
 * <p>
 * 检查记录进度表 前端控制器
 * </p>
 *
 * @author liangyt
 * @since 2021-01-02
 */
@Api(tags = "检测进度相关功能")
@RestController
@RequestMapping("/recordProcess")
@ResponseResult()
public class RecordProcessController extends BaseController {

    private final RecordProcessService recordProcessService;

    public RecordProcessController(RecordProcessService recordProcessService) {
        this.recordProcessService = recordProcessService;
    }

    @ApiOperation(value = "新增检测进度")
    @PostMapping("/save")
    public RecordProcessEntity save(@RequestBody RecordProcessEntity recordProcessEntity) {
        try {
            recordProcessService.save(recordProcessEntity);
            return recordProcessEntity;
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage());
        }
    }
}

